<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script src="jquery-3.2.1.min.js"></script>
		 
		<script>
		$(function(){
			$("input").toggle(function(){
				alert(4);
				$(this).val("1");
			},
			function(){
				//$("body").css("background-color","green");
				$(this).val("2");
			},
			function(){
				//$("body").css("background-color","yellow");
				$(this).val("3");
			}
			);
			
		});
		</script>
	</head>
	<body >
		<input type="button" value="变色" />
	</body>
</html>
